<template>
    <div class="box">
        <header class="header">
            <van-search v-model="value" placeholder="请输入搜索关键词" show-action @click-input="$router.push('/search')" />
        </header>
        <div class="content">

            <van-swipe :autoplay="3000" lazy-render>
                <van-swipe-item v-for="image in images" :key="image">
                    <img :src="image" style="width:100%;height:200px" />
                </van-swipe-item>
            </van-swipe>

            <van-grid>
                <van-grid-item
                    icon="https://m15.360buyimg.com/mobilecms/jfs/t1/187640/12/30456/5256/639c2315Ebc95c142/350a8f0c766f5460.png"
                    text="京东超市" />
                <van-grid-item
                    icon="https://m15.360buyimg.com/mobilecms/jfs/t1/149144/13/37547/3299/64b11027F86659ec1/fade439ac90544b7.png"
                    text="京东电器" />
                <van-grid-item icon="photo-o" text="文字" />
                <van-grid-item icon="photo-o" text="文字" />
            </van-grid>
            <!-- 3.调用 -->
            <ProList />
        </div>
    </div>
</template>

<script>
// 1.引入自定义组件
import ProList from './components/ProList.vue'
export default {
    // 2.注册
    components: {
        ProList
    },
    // 组合式API
    setup() {
        const images = [
            'https://fastly.jsdelivr.net/npm/@vant/assets/apple-1.jpeg',
            'https://fastly.jsdelivr.net/npm/@vant/assets/apple-2.jpeg',
        ];
        return { images };
    },
};
</script>

<style></style>